<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<script src="//unpkg.com/vue/dist/vue.js"></script>
		<title></title>
	</head>
	<body>
		<div id="app">
			<button-counter></button-counter>
			<!--组件的复用-->
			<button-counter></button-counter>
			<button-counter></button-counter>
			<button-counter></button-counter>
		</div>
	</body>
	<script>
		Vue.component('button-counter', {
			data: function() {
				return {
					count: 0
				}
			},
			template: '<button v-on:click="count++">You click me {{count}} times.</button>'
		} )
		
		new Vue({
			el:"#app"
		})
	</script>
</html>
